package com.s2u2m.training.ex_programmer.dependency_inversion.good;

import java.security.InvalidParameterException;

public class DatabaseFactory {
    public static final DatabaseFactory INSTANCE = new DatabaseFactory();
    public Database getDb(Db db) {
        switch (db) {
            case MYSQL:
                return new MySQL();
            case POSTGRE:
                return new Postgre();
            default:
                throw new InvalidParameterException();
        }
    }
}
